## read in data
winddirect <- read.table ("F:/Kathrin/Spezielle_Physische_Geo_R/Windrichtungen.dat",header = T, ",", fill= T)

##load necessary package
library (latticeExtra)

##as.POSIXct
winddirect$dateEAT <- as.POSIXct(winddirect$dateEAT)


##subset
subset_winddirect <- subset(winddirect, winddirect$wd_wxt!="NA", winddirect$plotID)

plot(subset_winddirect$dateEAT, subset_winddirect$plotID,subset_winddirect$wd_wxt, type="p", col="green", main="windrichtungen", xlab="Zeit", ylab="Winddirection")

rosavent(subset_winddirect$wd_wxt, "cof3")







##define plot object
xy <- xyplot(winddirect$wd_wxt ~ winddirect$dateEAT, type = "l")
xy

## define plot object - lines per plotID

##trellis function
??trellis function


xy <- xyplot(winddirect$wd_wxt ~ winddirect$dateEAT | winddirect$plotID, type = "l")
xy

## define plot object - get rid of useless plotID "", change line colour and 
## adjust layout so that panels are plotted columnwise
xy <- rosavent(winddirect$wd_wxt ~ winddirect$dateEAT | winddirect$plotID, 
             subset = winddirect$plotID != "", col = "mediumseagreen",
             type = "l", layout = c(1,2))
xy

## load package climatol 
library("climatol")
data (windrichtungen.dat)

##load package plotrix
library (plotrix)
winddirect$dateEAT <-as.POSIXct(winddirect$dateEAT)

rosavent (winddirect, dateEAT, wd_wxt)

data ("windfr")
rosavent(windfr, 4, 4, ang=-3*pi/16, main="Annual windrose")
